package com.xxl.job.executor.sample.frameless.test.exceptionDemo;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class ExceptionMain {
    public static void main(String[] args) {
        try {
            if (true){
                throw new MyException("自定义异常");
            }
            List<String> list = new ArrayList<>();
            list. add("x");
            Collection<String> cList = Collections. unmodifiableCollection(list);
            cList. add("y"); // 运行时此行报错
        } catch (MyException e) {
            System.out.println("自定义异常！");
        } catch (UnsupportedOperationException  e) {
            System.out.println("文件不可修改！");
        } catch (Exception e) {
            System.out.println("错误！");
        }
    }
}
